Xbasic

OBJECT.ACTIVE Function

Syntax

Control_Name as C = .Active([L fullname])

Arguments

fullname

Optional. Default = .F. (FALSE)

.F. = Returns control name.
.T. = Returns fully qualified control name.

Description

Returns the name of the control that has focus.

Discussion

The <OBJECT>.ACTIVE() method applies to:

Alpha Anywhere (for <OBJECT> use the keyword "A5")
Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)

The <OBJECT>.ACTIVE() method returns the name of the control with focus. If the .T. flag is specified, then a fully qualified name is returned. E.g. : sales.active(.T.)

Example

This script returns the name of the control on the Sales form that has focus.

name = :Sales.Active()

Limitations

Desktop applications only.

See Also